/*
 * Amazon Ads API - Sponsored Products
 * Use the Amazon Ads API for Sponsored Products for campaign, ad group, keyword, negative keyword, and product ad management operations. For more information about Sponsored Products, see the [Sponsored Products Support Center](https://advertising.amazon.com/help?entityId=ENTITY3CWETCZD9HEG2#GWGFKPEWVWG2CLUJ). For onboarding information, see the [account setup](setting-up/account-setup) topic.<br/><br/> 
 *
 * The version of the OpenAPI document: 2.0
 * 
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package org.openapitools.client.api;

import org.openapitools.client.ApiCallback;
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.ApiResponse;
import org.openapitools.client.Configuration;
import org.openapitools.client.Pair;
import org.openapitools.client.ProgressRequestBody;
import org.openapitools.client.ProgressResponseBody;

import com.google.gson.reflect.TypeToken;

import java.io.IOException;


import java.math.BigDecimal;
import org.openapitools.client.model.Error;
import org.openapitools.client.model.SnapshotRequest;
import org.openapitools.client.model.SnapshotResponse;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class SnapshotsApi {
    private ApiClient localVarApiClient;

    public SnapshotsApi() {
        this(Configuration.getDefaultApiClient());
    }

    public SnapshotsApi(ApiClient apiClient) {
        this.localVarApiClient = apiClient;
    }

    public ApiClient getApiClient() {
        return localVarApiClient;
    }

    public void setApiClient(ApiClient apiClient) {
        this.localVarApiClient = apiClient;
    }

    /**
     * Build call for downloadSnapshot
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param snapshotId The snapshot identifier. (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 307 </td><td> Successful operation. </td><td>  * Location -  <br>  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call downloadSnapshotCall(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal snapshotId, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/v2/sp/snapshots/{snapshotId}/download"
            .replaceAll("\\{" + "snapshotId" + "\\}", localVarApiClient.escapeString(snapshotId.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        if (amazonAdvertisingAPIClientId != null) {
            localVarHeaderParams.put("Amazon-Advertising-API-ClientId", localVarApiClient.parameterToString(amazonAdvertisingAPIClientId));
        }

        if (amazonAdvertisingAPIScope != null) {
            localVarHeaderParams.put("Amazon-Advertising-API-Scope", localVarApiClient.parameterToString(amazonAdvertisingAPIScope));
        }

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "bearer" };
        return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call downloadSnapshotValidateBeforeCall(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal snapshotId, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'amazonAdvertisingAPIClientId' is set
        if (amazonAdvertisingAPIClientId == null) {
            throw new ApiException("Missing the required parameter 'amazonAdvertisingAPIClientId' when calling downloadSnapshot(Async)");
        }
        
        // verify the required parameter 'amazonAdvertisingAPIScope' is set
        if (amazonAdvertisingAPIScope == null) {
            throw new ApiException("Missing the required parameter 'amazonAdvertisingAPIScope' when calling downloadSnapshot(Async)");
        }
        
        // verify the required parameter 'snapshotId' is set
        if (snapshotId == null) {
            throw new ApiException("Missing the required parameter 'snapshotId' when calling downloadSnapshot(Async)");
        }
        

        okhttp3.Call localVarCall = downloadSnapshotCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, snapshotId, _callback);
        return localVarCall;

    }

    /**
     * Downloads a previously requested snapshot.
     * **To understand the call flow for asynchronous snapshots, see [Getting started with sponsored ads snapshots](/API/docs/en-us/concepts/snapshots/sponsored-ads).**
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param snapshotId The snapshot identifier. (required)
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 307 </td><td> Successful operation. </td><td>  * Location -  <br>  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
     </table>
     */
    public void downloadSnapshot(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal snapshotId) throws ApiException {
        downloadSnapshotWithHttpInfo(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, snapshotId);
    }

    /**
     * Downloads a previously requested snapshot.
     * **To understand the call flow for asynchronous snapshots, see [Getting started with sponsored ads snapshots](/API/docs/en-us/concepts/snapshots/sponsored-ads).**
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param snapshotId The snapshot identifier. (required)
     * @return ApiResponse&lt;Void&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 307 </td><td> Successful operation. </td><td>  * Location -  <br>  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<Void> downloadSnapshotWithHttpInfo(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal snapshotId) throws ApiException {
        okhttp3.Call localVarCall = downloadSnapshotValidateBeforeCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, snapshotId, null);
        return localVarApiClient.execute(localVarCall);
    }

    /**
     * Downloads a previously requested snapshot. (asynchronously)
     * **To understand the call flow for asynchronous snapshots, see [Getting started with sponsored ads snapshots](/API/docs/en-us/concepts/snapshots/sponsored-ads).**
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param snapshotId The snapshot identifier. (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 307 </td><td> Successful operation. </td><td>  * Location -  <br>  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call downloadSnapshotAsync(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal snapshotId, final ApiCallback<Void> _callback) throws ApiException {

        okhttp3.Call localVarCall = downloadSnapshotValidateBeforeCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, snapshotId, _callback);
        localVarApiClient.executeAsync(localVarCall, _callback);
        return localVarCall;
    }
    /**
     * Build call for getSnapshotStatus
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param snapshotId The snapshot identifier. (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 307 </td><td> Temporary redirect. </td><td>  * Location -  <br>  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getSnapshotStatusCall(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal snapshotId, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = null;

        // create path and map variables
        String localVarPath = "/v2/sp/snapshots/{snapshotId}"
            .replaceAll("\\{" + "snapshotId" + "\\}", localVarApiClient.escapeString(snapshotId.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        if (amazonAdvertisingAPIClientId != null) {
            localVarHeaderParams.put("Amazon-Advertising-API-ClientId", localVarApiClient.parameterToString(amazonAdvertisingAPIClientId));
        }

        if (amazonAdvertisingAPIScope != null) {
            localVarHeaderParams.put("Amazon-Advertising-API-Scope", localVarApiClient.parameterToString(amazonAdvertisingAPIScope));
        }

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "bearer" };
        return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call getSnapshotStatusValidateBeforeCall(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal snapshotId, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'amazonAdvertisingAPIClientId' is set
        if (amazonAdvertisingAPIClientId == null) {
            throw new ApiException("Missing the required parameter 'amazonAdvertisingAPIClientId' when calling getSnapshotStatus(Async)");
        }
        
        // verify the required parameter 'amazonAdvertisingAPIScope' is set
        if (amazonAdvertisingAPIScope == null) {
            throw new ApiException("Missing the required parameter 'amazonAdvertisingAPIScope' when calling getSnapshotStatus(Async)");
        }
        
        // verify the required parameter 'snapshotId' is set
        if (snapshotId == null) {
            throw new ApiException("Missing the required parameter 'snapshotId' when calling getSnapshotStatus(Async)");
        }
        

        okhttp3.Call localVarCall = getSnapshotStatusCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, snapshotId, _callback);
        return localVarCall;

    }

    /**
     * Gets the status of a requested snapshot.
     * **To understand the call flow for asynchronous snapshots, see [Getting started with sponsored ads snapshots](/API/docs/en-us/concepts/snapshots/sponsored-ads).**
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param snapshotId The snapshot identifier. (required)
     * @return SnapshotResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 307 </td><td> Temporary redirect. </td><td>  * Location -  <br>  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
     </table>
     */
    public SnapshotResponse getSnapshotStatus(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal snapshotId) throws ApiException {
        ApiResponse<SnapshotResponse> localVarResp = getSnapshotStatusWithHttpInfo(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, snapshotId);
        return localVarResp.getData();
    }

    /**
     * Gets the status of a requested snapshot.
     * **To understand the call flow for asynchronous snapshots, see [Getting started with sponsored ads snapshots](/API/docs/en-us/concepts/snapshots/sponsored-ads).**
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param snapshotId The snapshot identifier. (required)
     * @return ApiResponse&lt;SnapshotResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 307 </td><td> Temporary redirect. </td><td>  * Location -  <br>  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<SnapshotResponse> getSnapshotStatusWithHttpInfo(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal snapshotId) throws ApiException {
        okhttp3.Call localVarCall = getSnapshotStatusValidateBeforeCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, snapshotId, null);
        Type localVarReturnType = new TypeToken<SnapshotResponse>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Gets the status of a requested snapshot. (asynchronously)
     * **To understand the call flow for asynchronous snapshots, see [Getting started with sponsored ads snapshots](/API/docs/en-us/concepts/snapshots/sponsored-ads).**
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param snapshotId The snapshot identifier. (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 200 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 307 </td><td> Temporary redirect. </td><td>  * Location -  <br>  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
        <tr><td> 404 </td><td> The requested resource was not found. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call getSnapshotStatusAsync(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, BigDecimal snapshotId, final ApiCallback<SnapshotResponse> _callback) throws ApiException {

        okhttp3.Call localVarCall = getSnapshotStatusValidateBeforeCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, snapshotId, _callback);
        Type localVarReturnType = new TypeToken<SnapshotResponse>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
    /**
     * Build call for requestSnapshot
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param recordType The type of entity for which the snapshot is generated. (required)
     * @param snapshotRequest  (required)
     * @param _callback Callback for upload/download progress
     * @return Call to execute
     * @throws ApiException If fail to serialize the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 202 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call requestSnapshotCall(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, String recordType, SnapshotRequest snapshotRequest, final ApiCallback _callback) throws ApiException {
        Object localVarPostBody = snapshotRequest;

        // create path and map variables
        String localVarPath = "/v2/sp/{recordType}/snapshot"
            .replaceAll("\\{" + "recordType" + "\\}", localVarApiClient.escapeString(recordType.toString()));

        List<Pair> localVarQueryParams = new ArrayList<Pair>();
        List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
        Map<String, String> localVarHeaderParams = new HashMap<String, String>();
        Map<String, String> localVarCookieParams = new HashMap<String, String>();
        Map<String, Object> localVarFormParams = new HashMap<String, Object>();

        if (amazonAdvertisingAPIClientId != null) {
            localVarHeaderParams.put("Amazon-Advertising-API-ClientId", localVarApiClient.parameterToString(amazonAdvertisingAPIClientId));
        }

        if (amazonAdvertisingAPIScope != null) {
            localVarHeaderParams.put("Amazon-Advertising-API-Scope", localVarApiClient.parameterToString(amazonAdvertisingAPIScope));
        }

        final String[] localVarAccepts = {
            "application/json"
        };
        final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
        if (localVarAccept != null) {
            localVarHeaderParams.put("Accept", localVarAccept);
        }

        final String[] localVarContentTypes = {
            "application/json"
        };
        final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
        localVarHeaderParams.put("Content-Type", localVarContentType);

        String[] localVarAuthNames = new String[] { "bearer" };
        return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
    }

    @SuppressWarnings("rawtypes")
    private okhttp3.Call requestSnapshotValidateBeforeCall(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, String recordType, SnapshotRequest snapshotRequest, final ApiCallback _callback) throws ApiException {
        
        // verify the required parameter 'amazonAdvertisingAPIClientId' is set
        if (amazonAdvertisingAPIClientId == null) {
            throw new ApiException("Missing the required parameter 'amazonAdvertisingAPIClientId' when calling requestSnapshot(Async)");
        }
        
        // verify the required parameter 'amazonAdvertisingAPIScope' is set
        if (amazonAdvertisingAPIScope == null) {
            throw new ApiException("Missing the required parameter 'amazonAdvertisingAPIScope' when calling requestSnapshot(Async)");
        }
        
        // verify the required parameter 'recordType' is set
        if (recordType == null) {
            throw new ApiException("Missing the required parameter 'recordType' when calling requestSnapshot(Async)");
        }
        
        // verify the required parameter 'snapshotRequest' is set
        if (snapshotRequest == null) {
            throw new ApiException("Missing the required parameter 'snapshotRequest' when calling requestSnapshot(Async)");
        }
        

        okhttp3.Call localVarCall = requestSnapshotCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, recordType, snapshotRequest, _callback);
        return localVarCall;

    }

    /**
     * Request a file-based snapshot of all entities of the specified type.
     * Request a file-based snapshot of all entities of the specified type in the account satisfying the filtering criteria.  **To understand the call flow for asynchronous snapshots, see [Getting started with sponsored ads snapshots](/API/docs/en-us/concepts/snapshots/sponsored-ads).**
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param recordType The type of entity for which the snapshot is generated. (required)
     * @param snapshotRequest  (required)
     * @return SnapshotResponse
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 202 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
     </table>
     */
    public SnapshotResponse requestSnapshot(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, String recordType, SnapshotRequest snapshotRequest) throws ApiException {
        ApiResponse<SnapshotResponse> localVarResp = requestSnapshotWithHttpInfo(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, recordType, snapshotRequest);
        return localVarResp.getData();
    }

    /**
     * Request a file-based snapshot of all entities of the specified type.
     * Request a file-based snapshot of all entities of the specified type in the account satisfying the filtering criteria.  **To understand the call flow for asynchronous snapshots, see [Getting started with sponsored ads snapshots](/API/docs/en-us/concepts/snapshots/sponsored-ads).**
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param recordType The type of entity for which the snapshot is generated. (required)
     * @param snapshotRequest  (required)
     * @return ApiResponse&lt;SnapshotResponse&gt;
     * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 202 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
     </table>
     */
    public ApiResponse<SnapshotResponse> requestSnapshotWithHttpInfo(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, String recordType, SnapshotRequest snapshotRequest) throws ApiException {
        okhttp3.Call localVarCall = requestSnapshotValidateBeforeCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, recordType, snapshotRequest, null);
        Type localVarReturnType = new TypeToken<SnapshotResponse>(){}.getType();
        return localVarApiClient.execute(localVarCall, localVarReturnType);
    }

    /**
     * Request a file-based snapshot of all entities of the specified type. (asynchronously)
     * Request a file-based snapshot of all entities of the specified type in the account satisfying the filtering criteria.  **To understand the call flow for asynchronous snapshots, see [Getting started with sponsored ads snapshots](/API/docs/en-us/concepts/snapshots/sponsored-ads).**
     * @param amazonAdvertisingAPIClientId The identifier of a client associated with a \&quot;Login with Amazon\&quot; developer account. (required)
     * @param amazonAdvertisingAPIScope The identifier of a profile associated with the advertiser account. Use &#x60;GET&#x60; method on Profiles resource to list profiles associated with the access token passed in the HTTP Authorization header. (required)
     * @param recordType The type of entity for which the snapshot is generated. (required)
     * @param snapshotRequest  (required)
     * @param _callback The callback to be executed when the API call finishes
     * @return The request call
     * @throws ApiException If fail to process the API call, e.g. serializing the request body object
     * @http.response.details
     <table summary="Response Details" border="1">
        <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
        <tr><td> 202 </td><td> Success. </td><td>  -  </td></tr>
        <tr><td> 401 </td><td> Unauthorized. </td><td>  -  </td></tr>
     </table>
     */
    public okhttp3.Call requestSnapshotAsync(String amazonAdvertisingAPIClientId, String amazonAdvertisingAPIScope, String recordType, SnapshotRequest snapshotRequest, final ApiCallback<SnapshotResponse> _callback) throws ApiException {

        okhttp3.Call localVarCall = requestSnapshotValidateBeforeCall(amazonAdvertisingAPIClientId, amazonAdvertisingAPIScope, recordType, snapshotRequest, _callback);
        Type localVarReturnType = new TypeToken<SnapshotResponse>(){}.getType();
        localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
        return localVarCall;
    }
}
